# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: sxe <sxxe@gmx.de>

pkgname=flowblade
pkgver=2.8.0.3
pkgrel=5
pkgdesc='Multitrack non-linear video editor'
arch=('any')
url='https://jliljebl.github.io/flowblade/'
license=('GPL3')
depends=('dbus-python' 'ffmpeg' 'frei0r-plugins' 'gmic' 'gtk3' 'mlt' 'python-cairo'
         'python-gobject' 'python-numpy' 'python-pillow' 'sdl_image' 'swh-plugins')
source=("https://github.com/jliljebl/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
         mlt7.patch)
sha256sums=('3753363d15caa6f1901118132a87f92d3b5e843c325775dbd83b30ee4d2a9bbf'
            '562da500893f04fdc3d02cd4242eccab88c1f58f58cd7fc8018cb255f7332c46')

prepare() {
  cd $pkgname-$pkgver/$pkgname-trunk
  _python_site_packages=`python -c 'import site; print(site.getsitepackages()[0])'`
  sed -i "s|/usr/share/pyshared/Flowblade|$_python_site_packages/Flowblade|" flowblade

  patch -p2 -i "$srcdir"/mlt7.patch # Update for MLT7
}

build() {
  cd $pkgname-$pkgver/$pkgname-trunk
  python setup.py build
}

package() {
  cd $pkgname-$pkgver/$pkgname-trunk
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}
